import 'package:flutter/material.dart';

class Test0011 extends StatefulWidget {
  const Test0011({super.key});

  @override
  State<Test0011> createState() => _Test0011State();
}

class _Test0011State extends State<Test0011> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("Dismissible"),
      ),
      body: ListView.builder(
        itemCount: 200,
        itemBuilder: (BuildContext context, int index) {
          return Dismissible(
            key: ValueKey(index),
            onDismissed: (DismissDirection direction) {
              //删除方向
            },
            child: Container(
              alignment: Alignment.center,
              height: 50,
              color: Colors.blue[index % 9 * 100],
              child: Text("$index"),
            ),
          );
        },
      ),
    );
  }
}
